package dbutil

import "fmt"

const UserTrigger = `create trigger user_trigger after insert on user
					for each row
					begin
					insert into user_message set user_id= new.user_id;
					end`

func createAfterTrigger(triggerName, action, tableName, sql string) string {
	return fmt.Sprintf(" create trigger %s after %s on %s for each row begin %s end;",
		triggerName, action, tableName, sql)
}
func createInsertTrigger(triggerName, tableName, sql string) string {
	return createAfterTrigger(triggerName, "insert", tableName, sql)
}
